<#import '/ftlLibrary/properteisVariable.ftl' as pv/>
<style>
    .bootbox-close-button {
        width: 19px;
        height: 19px;
        border: none;
        cursor: pointer;
        -webkit-appearance: none;
        float: right;
        top: 4px;
        left: -5px;
        position: relative;
        background: #E9F5FF url("assets/img/nav-img/icon_close.png") no-repeat 0 0;
    }

    .sysAdminUserEdit .modal-dialog {
        width: 60% !important;
    }

    .sysAdminUserEdit .modal-body {
        padding-bottom: 0;
    }

    input[type="text"], select {
        height: 30px !important;
        border-radius: 5px !important;
    }

    .sysAdminUserEdit .widget-body {
        box-shadow: none;
        background-color: #fff;
    }

    .addPartTime {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        background: #5db2ff;
        font-size: 30px;
        line-height: 25px;
        text-align: center;
        color: #fff;
        font-weight: bold;
        cursor: pointer;
    }
</style>
<div class="col-lg-12 col-sm-12 col-xs-12">
    <div class="modal-header">
        <button type="button" class="bootbox-close-button close" data-dismiss="modal" aria-hidden="true">x</button>
        <h4 class="modal-title">${(editModel=='add')?string('新增','编辑')}</h4>
    </div>
    <div class="widget-body">
        <div class="row">
            <form class="editForm" action="${saveUrl}" method="post" responseType="JSON" role="form"
                  id="editForm_${serializeNum}"
                  data-bv-submitButtons="#editFormSubmitBtn_${serializeNum}"
                  data-bv-message="This value is not valid"
                  data-bv-feedbackicons-valid="glyphicon glyphicon-ok"
                  data-bv-feedbackicons-invalid="glyphicon glyphicon-remove"
                  data-bv-feedbackicons-validating="glyphicon glyphicon-refresh">

                <input type="hidden" name="id" value="${editEntity.id}">
                <!--<input type="hidden" name="roleIds_old" value="${roleIds}">-->
                <input type="hidden" name="isForbidden" value="${editEntity.isForbidden}">

                <div class="col-lg-12 col-sm-12 col-xs-12">
                    <#if (true && editModel=='add')||(true && editModel=='edit')>
                        <div class="col-lg-6 col-sm-6 col-xs-6">
                            <div class="form-group">
                                <label for="realName"
                                       class="col-lg-4 col-sm-4 col-xs-4 control-label no-padding-right"><span
                                        class="red text-align-vertical-center">*</span>真实名称：</label>
                                <div class="col-lg-6 col-sm-6 col-xs-6">
                                    <input data-bv-message="请输入真实名称" required="required"
                                           onkeyup="inputValueLength(this,'name')"
                                           name="realName" alt="真实名称" id="realName" placeholder="真实名称"
                                           type="text" title="真实名称" class="form-control"
                                           value="${editEntity.realName}"/>
                                    <span class="text"></span>
                                </div>
                            </div>
                        </div>
                    </#if>
                    <#if (true && editModel=='add')||(true && editModel=='edit')>
                        <div class="col-lg-6 col-sm-6 col-xs-6">
                            <div class="form-group">
                                <label class="col-lg-4 col-sm-4 col-xs-4 control-label no-padding-right">员工性别：</label>
                                <div class="col-lg-6 col-sm-6 col-xs-6" style="max-width: 150px;margin-top: 5px;">
                                    <#if editEntity.sex == 1>
                                        <label>
                                            <input type="radio" name="sex" value="1"
                                                   style="margin-right: 5px;opacity: 1;position: static;height: 18px!important;"
                                                   checked="true">
                                        </label>
                                        <label style="margin-right: 10px">男</label>
                                        <label>
                                            <input type="radio" name="sex" value="2"
                                                   style="margin-right: 5px;opacity: 1;position: static;height: 18px!important;">
                                        </label>
                                        <label>女</label>
                                    <#else>
                                        <label>
                                            <input type="radio" name="sex" value="1"
                                                   style="margin-right: 5px;opacity: 1;position: static;height: 18px!important;">
                                        </label>
                                        <label style="margin-right: 10px">男</label>
                                        <label>
                                            <input type="radio" name="sex" value="2"
                                                   style="margin-right: 5px;opacity: 1;position: static;height: 18px!important;"
                                                   checked="true">
                                        </label>
                                        <label>女</label>
                                    </#if>
                                </div>
                            </div>
                        </div>
                    </#if>
                </div>

						<div class="col-lg-12 col-sm-12 col-xs-12">
							<#if (true && editModel=='add')||(true && editModel=='edit')>
								<div class="col-lg-6 col-sm-6 col-xs-6">
									<div class="form-group">
										<label class="col-lg-4 col-sm-4 col-xs-4 control-label no-padding-right"><span
												class="red text-align-vertical-center">*</span>联系电话：</label>
										<div class="col-lg-6 col-sm-6 col-xs-6">
											<input  required="required" disabled="disabled"
													data-bv-message="手机号已存在！"
													name="phoneNumber" alt="联系电话" id="phoneNumber"
												   placeholder="联系电话"
												   type="text" title="联系电话" class="form-control"
                                                    data-bv-regexp="true" maxlength="11"
                                                    data-bv-regexp-regexp="^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$"
                                                    data-bv-regexp-message="请输入正确的联系电话!"
												   value="${editEntity.phoneNumber}" />
											<span class="text"></span>


										</div>
									</div>
								</div>
							</#if>
						</div>

                <div class="col-lg-12 col-sm-12 col-xs-12">
                    <#if (true && editModel=='add')||(true && editModel=='edit')>
                        <div class="col-lg-6 col-sm-6 col-xs-6">
                            <div class="form-group">
                                <label for="birthdayDate"
                                       class="col-lg-4 col-sm-4 col-xs-4 control-label no-padding-right">出生年月：</label>
                                <div class="col-lg-6 col-sm-6 col-xs-6">
											<span class="input-icon icon-left">
												<input data-bv-date-format="YYYY-MM-DD"
                                                       name="birthdayDate" alt="出生日期" id="birthdayDate"
                                                       placeholder="出生年月"
                                                       type="text" title="出生日期"
                                                       class="form-control form-control date-picker"
                                                       onfocus="WdatePicker({doubleCalendar:true,dateFmt:'yyyy-MM-dd'})"
                                                       value="${editEntity.birthdayDate}"/>
												<i class="fa fa-calendar"></i>
											</span>
                                </div>
                            </div>
                        </div>
                    </#if>
                    <#if (true && editModel=='add')||(true && editModel=='edit')>
                        <div class="col-lg-6 col-sm-6 col-xs-6">
                            <div class="form-group">
                                <label for="nativePlace"
                                       class="col-lg-4 col-sm-4 col-xs-4 control-label no-padding-right">员工籍贯：</label>
                                <div class="col-lg-6 col-sm-6 col-xs-6">
                                    <input name="nativePlace" alt="籍贯" id="nativePlace"
                                           onkeyup="inputValueLength(this,'Chinese')"
                                           placeholder="籍贯" type="text" title="籍贯" class="form-control"
                                           value="${editEntity.nativePlace}"/>
                                    <span class="text"></span>
                                </div>
                            </div>
                        </div>
                    </#if>
                </div>

                <div class="col-lg-12 col-sm-12 col-xs-12">
                    <#if (true && editModel=='add')||(true && editModel=='edit')>
                        <div class="col-lg-6 col-sm-6 col-xs-6">
                            <div class="form-group">
                                <label class="col-lg-4 col-sm-4 col-xs-4 control-label no-padding-right"><span
                                        class="red text-align-vertical-center">*</span>员工职务：</label>
                                <div class="col-lg-6 col-sm-6 col-xs-6">
                                    <select name="post" class="form-control" id="post" required="required"
                                            data-bv-message="请选择员工职务">
                                        <option value="">请选择</option>
                                        <@dictionary groupCode="post";dics>
                                        <#list dics as dic>
                                            <#if editEntity.post == dic.code>
                                                <option value="${dic.code}" selected="selected">${dic.value}</option>
                                                <#else>
                                                    <option value="${dic.code}">${dic.value}</option>
                                            </#if>
                                        </#list>
                                    </@dictionary>
                                    </select>
                                    <span class="text"></span>
                                </div>
                            </div>
                        </div>
                    </#if>
                </div>

                <div class="col-lg-12 col-sm-12 col-xs-12">
                    <#if (true && editModel=='add')||(true && editModel=='edit')>
                        <div class="col-lg-12 col-sm-12 col-xs-12">
                            <div class="form-group" id="partTimeBox">
                                <label class="col-lg-2 col-sm-2 col-xs-2 control-label no-padding-right">兼任职务：</label>
                                <@dictionary groupCode="post";dics>
                                <#list editEntity.partTime?split(',') as oldDic>
                                    <div class="col-lg-3 col-sm-3 col-xs-3 partTimeBox">
                                        <select name="partTime" class="form-control" id="partTime">
                                            <option value="">请选择</option>
                                            <@dictionary groupCode="post";dics>
                                            <#list dics as dic>
                                                <#if oldDic == dic.code>
                                                    <option value="${dic.code}" selected="selected">${dic.value}</option>
                                                <#else>
                                                    <option value="${dic.code}">${dic.value}</option>
                                                </#if>
                                            </#list>
                                            </@dictionary>
                                        </select>
                                        <span class="text"></span>
                                    </div>
                                </#list>
                                </@dictionary>
                                <div class="col-lg-1 col-sm-1 col-xs-1" id="addPartTime">
                                    <div class="addPartTime">+</div>
                                </div>
                            </div>
                        </div>
                    </#if>
                </div>

        <div class="col-lg-12 col-sm-12 col-xs-12">
            <#if (true && editModel=='add')||(true && editModel=='edit')>
                <div class="col-lg-6 col-sm-6 col-xs-6">
                    <div class="form-group">
                        <label class="col-lg-4 col-sm-4 col-xs-4 control-label no-padding-right">员工民族：</label>
                        <div class="col-lg-6 col-sm-6 col-xs-6">
                            <select name="nation" class="form-control">
                                <option value="">请选择</option>
                                <@dictionary groupCode="nation";dics>
                                <#list dics as dic>
                                    <#if editEntity.nation == dic.code>
                                        <option value="${dic.code}" selected="selected">${dic.value}</option>
                                        <#else>
                                            <option value="${dic.code}">${dic.value}</option>
                                    </#if>
                                </#list>
                            </@dictionary>
                            </select>
                        </div>
                    </div>
                </div>
            </#if>
            <#if (true && editModel=='add')||(true && editModel=='edit')>
                <div class="col-lg-6 col-sm-6 col-xs-6">
                    <div class="form-group">
                        <label class="col-lg-4 col-sm-4 col-xs-4 control-label no-padding-right">员工学历：</label>
                        <div class="col-lg-6 col-sm-6 col-xs-6">
                            <select name="educationBackground" class="form-control">
                                <option value="">请选择</option>
                                <@dictionary groupCode="education";dics>
                                <#list dics as dic>
                                    <#if editEntity.educationBackground == dic.code>
                                        <option value="${dic.code}" selected="selected">${dic.value}</option>
                                        <#else>
                                            <option value="${dic.code}">${dic.value}</option>
                                    </#if>
                                </#list>
                                </@dictionary>
                            </select>
                        </div>
                    </div>
                </div>
            </#if>
        </div>

        <div class="col-lg-12 col-sm-12 col-xs-12">
            <#if (true && editModel=='add')||(true && editModel=='edit')>
                <div class="col-lg-6 col-sm-6 col-xs-6">
                    <div class="form-group">
                        <label class="col-lg-4 col-sm-4 col-xs-4 control-label no-padding-right">入职时间：</label>
                        <div class="col-lg-6 col-sm-6 col-xs-6">
											<span class="input-icon icon-left">
												<input data-bv-date-format="YYYY-MM-DD"
                                                       name="entryTime" alt="入职时间" id="entryTime" placeholder="入职时间"
                                                       type="text" title="入职时间"
                                                       class="form-control form-control date-picker"
                                                       onfocus="WdatePicker({doubleCalendar:true,dateFmt:'yyyy-MM-dd'})"
                                                       value="${editEntity.entryTime}"/>
												<i class="fa fa-calendar"></i>
											</span>
                        </div>
                    </div>
                </div>
            </#if>
            <#if (true && editModel=='add')||(true && editModel=='edit')>
                <div class="col-lg-6 col-sm-6 col-xs-6">
                    <div class="form-group">
                        <label class="col-lg-4 col-sm-4 col-xs-4 control-label no-padding-right">身份证号：</label>
                        <div class="col-lg-6 col-sm-6 col-xs-6">
                            <input data-bv-message="请输入身份证号"
                                   name="idCardNum" alt="身份证号" id="idCardNum" placeholder="身份证号"
                                   type="text" title="身份证号" class="form-control"
                                   onkeyup="inputValueLength(this,'IDnumber')"
                                   value="${editEntity.idCardNum}"/>
                            <span class="text"></span>
                        </div>
                    </div>
                </div>
            </#if>
        </div>

						<div class="col-lg-12 col-sm-12 col-xs-12">
							<#if (true && editModel=='add')||(true && editModel=='edit')>
								<div class="col-lg-6 col-sm-6 col-xs-6">
									<div class="form-group">
										<label class="col-lg-4 col-sm-4 col-xs-4 control-label no-padding-right"><span
												class="red text-align-vertical-center">*</span>所属园所：</label>
										<div class="col-lg-6 col-sm-6 col-xs-6">
											<select name="schoolId"  disabled="disabled"
                                                    data-bv-message="未输入手机号或手机号在该园所已存在！"
                                                    required="required"
													value="${editEntity.schoolId}"
                                                    class=" schoolId"
													alt="所属园所"
													placeholder="所属园所" type="text" >
											</select>
                                            <span class="text"></span>
										</div>
									</div>
								</div>
							</#if>
						</div>

        <#if (false && editModel=='add')||(true && editModel=='edit')>
            <#if editEntity.isOpenAccount == true>
                <div class="col-lg-12 col-sm-12 col-xs-12">
                    <hr>
                </div>
                <div class="col-lg-12 col-sm-12 col-xs-12">
                    <div class="col-lg-12 col-sm-12 col-xs-12">
                        <div class="form-group">
                            <label class="col-lg-2 col-sm-2 col-xs-2 control-label no-padding-right"><span
                                    class="red">*</span>权限设置：</label>
                            <div class="col-lg-10 col-sm-10 col-xs-10 control-label text-align-left">
                                <#list rolesList as roles>
                                    <input type="hidden" name="roleIds_old" value="${roles.roleId}">
                                    <#list schoolRoleList as role>
                                        <#if roles.roleId == role.id>
                                            <label>
                                                <input type="radio" name="roleIds" value="${role.id}"
                                                       style="margin-right: 5px;opacity: 1;position: static;height: 18px!important;margin-top: 4px!important;" checked>
                                            </label>
                                            <label style="margin-right: 10px">${role.roleName}</label>
                                        <#else>
                                            <label>
                                                <input type="radio" name="roleIds" value="${role.id}"
                                                       style="margin-right: 5px;opacity: 1;position: static;height: 18px!important;margin-top: 4px!important;">
                                            </label>
                                            <label style="margin-right: 10px">${role.roleName}</label>
                                        </#if>
                                    </#list>
                                </#list>
                            </div>
                        </div>
                    </div>
                </div>
            </#if>
        </#if>

        <div class="col-lg-12 col-sm-12 col-xs-12">
            <div class="text-align-center ">
                <button style="min-width: 80px;margin-right:20px;" type="submit" class="btn btn-blue"
                        id="editFormSubmitBtn_${serializeNum}">确定
                </button>
                <button style="width: 80px" type="button" class="btn btn-blue" data-dismiss="modal">取消</button>
            </div>
        </div>


        <input type="hidden" name="userName" value="${editEntity.userName}">
        <#if (false && editModel=='add')||(false && editModel=='edit')>
            <div class="col-lg-6 col-sm-6 col-xs-6">
                <div class="form-group">
                    <label for="userName" class="col-lg-4 col-sm-4 col-xs-4 control-label no-padding-right"><span
                            class="red text-align-vertical-center">*</span>用户名：</label>
                    <div class="col-lg-6 col-sm-6 col-xs-6">
                        <input data-bv-remote="true"
                               data-bv-remote-url="sysAdminUserController/verificationUserName.do?id=${editEntity.id}"
                               data-bv-remote-message="用户名已存在！" required="required"
                               data-bv-message="请填写用户名！" maxlength="12" name="userName" alt="用户名"
                               id="userName" placeholder="用户名" type="text" title="用户名"
                               class="form-control" value="${editEntity.userName}"/>
                        <span class="text"></span>
                    </div>
                </div>
            </div>
        </#if>

        <input type="hidden" name="userPassword" value="${editEntity.userPassword}">
        <#if (false && editModel=='add')||(false && editModel=='edit')>
            <div class="col-xm-12 col-sm-6 col-lg-4">
                <div class="form-group">
                    <label for="userPassword" class="col-sm-2 control-label no-padding-right"><span
                            class="red text-align-vertical-center">*</span>密码</label>
                    <div class="col-sm-10">
                        <input required="required" data-bv-message="请填写密码！" maxlength="50" name="userPassword" alt="密码"
                               id="userPassword" placeholder="密码" type="password" title="密码" class="form-control"
                               value="${editEntity.userPassword}"/>
                        <span class="text"></span>
                    </div>
                </div>
            </div>
        </#if>

        <input type="hidden" name="email" value="${editEntity.email}">
        <#if (false && editModel=='add')||(false && editModel=='edit')>
            <div class="col-xm-12 col-sm-6 col-lg-4">
                <div class="form-group">
                    <label for="email" class="col-sm-2 control-label no-padding-right">邮箱</label>
                    <div class="col-sm-10">
                        <input data-bv-message="The field is not valid" maxlength="50" name="email" alt="邮箱" id="email"
                               placeholder="邮箱" type="text" title="邮箱" class="form-control"
                               value="${editEntity.email}"/>
                        <span class="text"></span>
                    </div>
                </div>
            </div>
        </#if>

        <input type="hidden" name="wechat" value="${editEntity.wechat}">
        <#if (false && editModel=='add')||(false && editModel=='edit')>
            <div class="col-xm-12 col-sm-6 col-lg-4">
                <div class="form-group">
                    <label for="wechat" class="col-sm-2 control-label no-padding-right">微信</label>
                    <div class="col-sm-10">
                        <input data-bv-message="The field is not valid" maxlength="20" name="wechat" alt="微信"
                               id="wechat" placeholder="微信" type="text" title="微信" class="form-control"
                               value="${editEntity.wechat}"/>
                        <span class="text"></span>
                    </div>
                </div>
            </div>
        </#if>

        <input type="hidden" name="qq" value="${editEntity.qq}">
        <#if (false && editModel=='add')||(false && editModel=='edit')>
            <div class="col-xm-12 col-sm-6 col-lg-4">
                <div class="form-group">
                    <label for="qq" class="col-sm-2 control-label no-padding-right">QQ</label>
                    <div class="col-sm-10">
                        <input data-bv-message="The field is not valid" maxlength="15" name="qq" alt="QQ" id="qq"
                               placeholder="QQ" type="text" title="QQ" class="form-control" value="${editEntity.qq}"/>
                        <span class="text"></span>
                    </div>
                </div>
            </div>
        </#if>

        <input type="hidden" name="festnetznummer" value="${editEntity.festnetznummer}">
        <#if (false && editModel=='add')||(false && editModel=='edit')>
            <div class="col-xm-12 col-sm-6 col-lg-4">
                <div class="form-group">
                    <label for="festnetznummer" class="col-sm-2 control-label no-padding-right">座机号</label>
                    <div class="col-sm-10">
                        <input data-bv-message="The field is not valid" maxlength="12" name="festnetznummer" alt="座机号"
                               id="festnetznummer" placeholder="座机号" type="text" title="座机号" class="form-control"
                               value="${editEntity.festnetznummer}"/>
                        <span class="text"></span>
                    </div>
                </div>
            </div>
        </#if>

        <#if (false && editModel=='add')||(false && editModel=='edit')>
            <div class="col-xm-12 col-sm-6 col-lg-4">
                <div class="form-group">
                    <label class="col-sm-2 control-label no-padding-right"><span class="red text-align-vertical-center">*</span>角色名称</label>
                    <div class="col-sm-10">
                        <select multiple="true" required="required" data-bv-message="请选择角色名称！" name="roleIds" id=""
                                class="selectpicker_${serializeNum}" data-live-search="true">
                            <optgroup label="选择所属分组" data-icon="icon-ok">
                                <#list roleId_datasources as datasources >
                                    <option value="${datasources.id}">${datasources.roleName}</option>
                                </#list>
                            </optgroup>
                        </select>
                    </div>
                </div>
            </div>
        </#if>

        <input type="hidden" name="isCanDelete" value="${editEntity.isCanDelete}">
        <#if (false && editModel=='add')||(false && editModel=='edit')>
            <div class="col-xm-12 col-sm-6 col-lg-4">
                <div class="form-group has-feedback">
                    <label for="isCanDelete" class="col-sm-2 control-label no-padding-right">是否可删除</label>
                    <div class="col-sm-10">
                        <input type="hidden" name="isCanDelete"
                               value=${(editEntity.isCanDelete???string(editEntity.isCanDelete?string('true','false'),'false'))!'false'}>
                        <label>
                            <input data-target-input-name="isCanDelete" data-bv-message="The field is not valid"
                                   maxlength="1" alt="是否可删除" id="isCanDelete" placeholder="是否可删除" type="checkbox"
                                   title="是否可删除" class="form-control checkbox-slider slider-icon yesno"
                                   ${(editEntity.isCanDelete???string(editEntity.isCanDelete?string('checked',''),''))!''}>
                            <span class="text"></span>
                        </label>
                    </div>
                </div>
            </div>
        </#if>

        <input type="hidden" name="createTime" value="${editEntity.createTime}">
        <#if (false && editModel=='add')||(false && editModel=='edit')>
            <div class="col-xm-12 col-sm-6 col-lg-4">
                <div class="form-group">
                    <label for="createTime" class="col-sm-2 control-label no-padding-right">创建时间</label>
                    <div class="col-sm-10">
										<span class="input-icon icon-left">
											<input data-bv-date-format="YYYY-MM-DD hh:mm:ss"
                                                   data-bv-message="The field is not valid"
                                                   data-bv-date-message="请正确输入一个时间" data-bv-date="true" maxlength="19"
                                                   name="createTime" alt="创建时间" id="createTime" placeholder="创建时间"
                                                   type="text" title="创建时间"
                                                   class="form-control form-control date-picker"
                                                   onfocus="WdatePicker({doubleCalendar:true,dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                                                   value="${editEntity.createTime}"/>
											<i class="fa fa-calendar"></i>
										</span>
                    </div>
                </div>
            </div>
        </#if>

        <input type="hidden" name="lastUpdateTime" value="${editEntity.lastUpdateTime}">
        <#if (false && editModel=='add')||(false && editModel=='edit')>
            <div class="col-xm-12 col-sm-6 col-lg-4">
                <div class="form-group">
                    <label for="lastUpdateTime" class="col-sm-2 control-label no-padding-right">最后修改时间</label>
                    <div class="col-sm-10">
										<span class="input-icon icon-left">
											<input data-bv-date-format="YYYY-MM-DD hh:mm:ss"
                                                   data-bv-message="The field is not valid"
                                                   data-bv-date-message="请正确输入一个时间" data-bv-date="true" maxlength="19"
                                                   name="lastUpdateTime" alt="最后修改时间" id="lastUpdateTime"
                                                   placeholder="最后修改时间" type="text" title="最后修改时间"
                                                   class="form-control form-control date-picker"
                                                   onfocus="WdatePicker({doubleCalendar:true,dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                                                   value="${editEntity.lastUpdateTime}"/>
											<i class="fa fa-calendar"></i>
										</span>
                    </div>
                </div>
            </div>
        </#if>

        <input type="hidden" name="createUser" value="${editEntity.createUser}">
        <#if (false && editModel=='add')||(false && editModel=='edit')>
            <div class="col-xm-12 col-sm-6 col-lg-4">
                <div class="form-group">
                    <label for="createUser" class="col-sm-2 control-label no-padding-right">创建人</label>
                    <div class="col-sm-10">
                        <input data-bv-message="The field is not valid" maxlength="32" name="createUser" alt="创建人"
                               id="createUser" placeholder="创建人" type="text" title="创建人" class="form-control"
                               value="${editEntity.createUser}"/>
                        <span class="text"></span>
                    </div>
                </div>
            </div>
        </#if>

        <#if (false && editModel=='add')||(false && editModel=='edit')>
            <div class="col-xm-12 col-sm-6 col-lg-4">
                <div class="form-group has-feedback">
                    <label for="isForbidden" class="col-sm-2 control-label no-padding-right">是否禁用</label>
                    <div class="col-sm-10">
                        <input type="hidden" name="isForbidden"
                               value=${(editEntity.isForbidden???string(editEntity.isForbidden?string('true','false'),'false'))!'false'}>
                        <label>
                            <input data-target-input-name="isForbidden" data-bv-message="The field is not valid"
                                   maxlength="1" alt="是否禁用" id="isForbidden" placeholder="是否禁用" type="checkbox"
                                   title="是否禁用" class="form-control checkbox-slider slider-icon yesno"
                                   ${(editEntity.isForbidden???string(editEntity.isForbidden?string('checked',''),''))!''}>
                            <span class="text"></span>
                        </label>
                    </div>
                </div>
            </div>
        </#if>

        <input type="hidden" name="version" value="${editEntity.version}">
        <#if (false && editModel=='add')||(false && editModel=='edit')>
            <div class="col-xm-12 col-sm-6 col-lg-4">
                <div class="form-group">
                    <label for="version" class="col-sm-2 control-label no-padding-right">版本</label>
                    <div class="col-sm-10">
                        <input data-bv-integer-message="The field is number" data-bv-message="The field is not valid"
                               data-bv-integer="true" maxlength="11" name="version" alt="版本" id="version"
                               placeholder="版本" type="text" title="版本" class="form-control"
                               value="${editEntity.version}"/>
                        <span class="text"></span>
                    </div>
                </div>
            </div>
        </#if>

        <#if (false && editModel=='add')||(false && editModel=='edit')>
            <div class="col-xm-12 col-sm-6 col-lg-4">
                <input type="hidden" name="headPortrait" value="${editEntity.headPortrait}">
                <input type="hidden" name="deleteHeadPortrait">
                <div class="form-group">
                    <label for="headPortrait" class="col-sm-2 control-label no-padding-right">头像</label>
                    <div class="col-sm-10">
                        <div class="col-xs-9">
                            <input data-bv-message="The field is not valid" maxlength="100" name="newHeadPortrait"
                                   id="headPortrait${serializeNum}" readonly="readonly" alt="头像" placeholder="头像"
                                   type="text" title="头像" class="form-control"/>
                            <span class="text"></span>
                        </div>
                        <div class="col-sm-2">
                            <a href="javascript:void(0);" class="btn theme"
                               onclick="uploadHeadPortrait('editForm_${serializeNum}','newHeadPortrait','headPortrait','headPortrait_imgPrev${serializeNum}','headPortrait')"><i
                                    class="fa fa-upload"></i>上传</a>
                        </div>
                        <div class="col-sm-12 imgPrev" id="headPortrait_imgPrev${serializeNum}">
                            <@config key="qiniu.domain" inner="true";qiniuDomin>
                            <@file fileIds=editEntity.headPortrait separator=',';files>
                            <#list files as file>
                                <p>
                                    <!--<img src="${pv.fileRedPath}/${file.relativePath}/${file.fileName}" width="50" height="50">-->
                                    <img src="http://${qiniuDomin}/${file.qiniuKey}" width="50" height="50"
                                         class="imgViewer">
                                    ${file.fileName}
                                    <#if file.size??>&nbsp;&nbsp;尺寸:${file.size}</#if>
                                    <a class="btn btn-default btn-xs icon-only red delete textAling-right"
                                       href="javascript:void(0);"
                                       onclick="removeFileUseLog(this,'editForm_${serializeNum}','deleteHeadPortrait','headPortrait','${file.id}')"><i
                                            class="fa fa-trash-o"></i></a>
                                </p>
                            </#list>
                        </@file>
                    </@config>
                </div>
            </div>
    </div>
</div>
<script type="text/javascript">
    function uploadHeadPortrait(formId, targetShowInputName, targetHideInputName, imgPrevId, groupName) {
        showUploadFileDialog({
            groupName: groupName,//该参数将参与文件缓存时的唯一标识值,如果配置了文件服务器,该参数同时会参与文件服务器文件存储目录分配,为保证文件不丢失, 务必保证同一编辑页面此参数唯一
            size: "large",//文件上传组件层大小，small 小,large 大
            title: "文件上传",//文件上传组件层标题
            width: "",//文件上传组件层宽度
            height: "",//文件上传组件层高度
            fileNumLimit: 1,//验证文件总数量, 超出则不允许加入队列
            fileSizeLimit: "209715200",// 验证文件总大小是否超出限制, 超出则不允许加入队列
            fileSingleSizeLimit: "52428800",
            accept: {
                title: "图片文件",//文字描述
                extensions: "gif,jpg,jpeg,bmp,png,psd",//允许的文件后缀，不带点，多个用逗号分割
                mimeTypes: "image/jpg,image/jpeg,image/png,image/gif,image/bmp,image/psd"// 多个用逗号分割
            },
            imgMaxWidth: "-1",//图片文件允许的最大宽度
            imgMaxHeight: "-1",// 图片文件允许的最大高度
            sizes: '',//缩放尺寸(格式：宽度-高度,宽度-高度,宽度-高度....),如：500-300,400-300
        }, function (result) {//点击确认的回调函数
            if (result) {
                console.log(result.fileList);
                var showWidth = 50, showHeight = 50;
                var fileList = result.fileList;
                $("#" + imgPrevId + " p a").click();
                for (var i = 0, len = fileList.length; i < len; i++) {
                    var file = fileList[i];
                    var width = file.size.width;
                    var height = file.size.height;
                    var uuid = file.uuid;
                    var targetInput = $("#" + formId + " [name='" + targetShowInputName + "']").val(groupName + "=>" + targetHideInputName);
                    if (width == -1 && height == -1) {
                        $("#" + imgPrevId).append('<p><img  class="imgViewer"  src="fileUpload/previewUploadImg.do?groupName=' + groupName + '&fileId=' + uuid + '" width="' + showWidth + '" height="' + showHeight + '">' + file.name + '<a class="btn btn-default btn-xs icon-only red delete" href="javascript:void(0);" onclick="removeHeadPortraitUploadTempleFile(this,' + "'" + groupName + "','" + uuid + "'" + ')"><i class="fa fa-trash-o"></i></a></p>');
                    }
                }
            }
        }, function () {//点击取消的回调函数
            console.log("执行关闭/取消的回调函数");
        })
    }

    //移除临时文件
    function removeHeadPortraitUploadTempleFile(that, groupName, uuid) {
        console.log("clear temp file  by  id...")
        ajaxRequest("fileUpload/clearTempFile.do", {groupName: groupName, fileId: uuid}, function (result) {
                if (result.resCode == "200") {
                    console.log("成功清除缓存文件：" + uuid);
                    $(that).parents("p").remove();
                } else {
                    var message = result.resMsg;
                    bootbox.alert({
                        title: "错误提示",
                        size: 'small',
                        message: message
                    });
                }
            },
            function (XMLHttpRequest, textStatus, errorThrown) {
                ajaxError(errorThrown);
            }, "GET", "JSON")
    }
</script>
</#if>
<!--<div class="col-sm-12">-->
<!--&lt;!&ndash;<#if sign??>-->
<!--<input type="button" class="btn btn-default" data-dismiss="modal" value="返回" onclick="backView1()"/>-->
<!--<#else>-->
<!--<input type="button" class="btn btn-default" data-dismiss="modal" value="返回" onclick="backView()"/>-->
<!--</#if>-->
<!--<button type="submit" class="btn btn-blue" id="editFormSubmitBtn_${serializeNum}">保存</button>&ndash;&gt;-->
<!--</div>-->
</form>
</div>
</div>
</div>
<script src="assets/js/validation/bootstrapValidator_init.js"></script>
<script src="assets/js/select2/select2.js"></script>
<script>

    /**
     * 获取所属园所
     */
    $(function () {
        var loginUserId=loginAdminUserId;
        ajaxRequest("sysSchoolController/sysSchoolAllList.do", null, function (result) {
            var data = result.data;
            var arr=[];
            if(loginUserId=='40280981582deed501582dfc94a40000'){
                arr = ['<option value="">请选择</option>'];
            }
            var school = $(".schoolId").attr("value");
            $.each(data, function (i, t) {
                if (school == t.id) {
                    arr.push('<option value="' + t.id + '" selected="selected">' + t.name + '</option>')
                } else {
                    arr.push('<option value="' + t.id + '">' + t.name + '</option>')
                }

            })
            $(".schoolId").html(arr.join(''))

            $(".schoolId").select2();
        }, function () {
            ajaxError("加载园所失败");
        }, "get", "json")

        //动态添加验证
        $("[name='phoneNumber'],[name='schoolId']").removeAttr("disabled");
        var formValidation = $('#editForm_${serializeNum}').data('bootstrapValidator');
        formValidation.addField("phoneNumber",{
            validators:{
                remote:{
                    url:"sysAdminUserController/verificationPhone.do",
                    type: 'POST',
                    data: function(validator, $field, value) {
                        return {
                            id:"${editEntity.id}",
                            schoolId: validator.getFieldElements('schoolId').val(),
                            phoneNumber: validator.getFieldElements('phoneNumber').val()
                        };
                    }
                }
            }
        });
        if(loginUserId=='40280981582deed501582dfc94a40000'){
            formValidation.addField("schoolId",{
                validators:{
                    remote:{
                        url:"sysAdminUserController/verificationPhone.do",
                        type: 'POST',
                        data: function(validator, $field, value) {
                            return {
                                id:"${editEntity.id}",
                                schoolId: validator.getFieldElements('schoolId').val(),
                                phoneNumber: validator.getFieldElements('phoneNumber').val()
                            };
                        }
                    }
                }
            });
        }
    });

    initImgPrev($(".imgPrev"));
    var arr = '${roleIds}'.split(",");
    $("[name='roleIds']").select2("val", arr);

    function removeFileUseLog(that, formId, targetDeleteInputName, targetHideInputName, fileId) {
        var useFileIds = $("#" + formId + " [name='" + targetHideInputName + "']");
        var targetDeleteInput = $("#" + formId + " [name='" + targetDeleteInputName + "']");
        var ids = useFileIds.val().split(",");
        var newIds = "";
        for (var i = 0, len = ids.length; i < len; i++) {
            if (ids[i] == fileId) {
                targetDeleteInput.val(targetDeleteInput.val() + "," + fileId);
                continue;
            }
            newIds += ids[i];
            if (i != len - 1) {
                newIds += ",";
            }
        }
        useFileIds.val(newIds);
        $(that).parents("p").remove();
    }

    function backView1() {
        //toView("/ti/tiDesignateOrderController/tiDesignateOrderList.do",false);
        window.location.reload();
    }

    if ('${sign}' != '') {
        $("#editForm_${serializeNum}").on("ajaxSubmitCallback", function (event, data) {
            if (data.resCode == 200) {
                alert(data.resMsg);
                resetValidatorForm(this);
                if (isInnerEdit == true) {
                    backView1();
                } else {
                    dialog.modal("hide");
                    that.parents(".widget").find(".searchCriteria .widget-buttons .businessBtns .search").click();
                }
            } else {
                ajaxError(data.resMsg);
            }
        });
    }

</script>
<script>
    $(".addPartTime").click(function () {
        var partTimeBox = $("#partTimeBox").find(".partTimeBox").length;
        if (partTimeBox < 2) {
            var html = '<div class="col-lg-3 col-sm-3 col-xs-3 partTimeBox">' +
                '<select name="partTime" class="form-control" id="partTime1" onchange="aaa()">' +
                '<option value="">请选择</option>' +
                '<@dictionary groupCode="post";dics>' +
                '<#list dics as dic>' +
                '<#if editEntity.partTime == dic.code>' +
                '<option value="${dic.code}" selected="selected">${dic.value}</option>' +
                '<#else>' +
                '<option value="${dic.code}">${dic.value}</option>' +
                '</#if>' +
                '</#list>' +
                '</@dictionary>' +
                '</select>' +
                '<span class="text"></span>' +
                '</div>'
            $("#addPartTime").before(html);
        }
    })

    $("#post").change(function () {
        var partTime = $("#partTime").val();
        var partTime1 = $("#partTime1").val();
        var post = $(this).val();
        if (partTime == post || partTime1 == post) {
            $(this).val('<option value="">请选择</option>');
            logger.error("职务不能重复!");
        }
    });

    $("#partTime").change(function () {
        var post = $("#post").val();
        var partTime = $(this).val();
        var partTime1 = $("#partTime1").val();
        if (partTime == post || partTime == partTime1) {
            $(this).val('<option value="">请选择</option>');
            logger.error("职务不能重复!");
        }
    });

    function aaa() {
        var post = $("#post").val();
        var partTime = $("#partTime").val();
        var partTime1 = $("#partTime1").val();
        if (partTime1 == post || partTime1 == partTime) {
            $("#partTime1").val('<option value="">请选择</option>');
            logger.error("职务不能重复!");
        }
    }

    /**
     * 表单校验
     */
    function inputValueLength(that, type) {
        if (type == 'Chinese') {
            if (/[-=;,./!@#$%^&*(){}:<>?_+！￥…（）：《》？|—\[\]]/.test(that.value)) {
                $(that).val(that.value.replace(/[-=;,./!@#$%^&*(){}:<>?_+！￥…（）：《》？|—\[\]]/g, ""));
                logger.error("输入格式不正确!");
            } else {
                if (that.value.replace(/[^\x00-\xff]/g, "aa").length > 40) {
                    $(that).val(that.value.substring(0, 40));
                    logger.error("长度超过限制!");
                }
            }
        }
        if (type == 'name') {
            if (/[-=;,./!@#$%^&*(){}:<>?_+！￥…（）：《》？|—\[\]]/.test(that.value)) {
                $(that).val(that.value.replace(/[-=;,./!@#$%^&*(){}:<>?_+！￥…（）：《》？|—\[\]]/g, ""));
                logger.error("输入格式不正确!");
            } else {
                if (that.value.replace(/[^\x00-\xff]/g, "aa").length > 12) {
                    $(that).val(that.value.substring(0, 12));
                    logger.error("长度超过限制!");
                }
            }
        }
        if (type == 'noSymbol') {
            if (/[-=;,./!@#$%^&*(){}:<>?_+！￥…（）：《》？|—\[\]]/.test(that.value)) {
                $(that).val(that.value.replace(/[-=;,./!@#$%^&*(){}:<>?_+！￥…（）：《》？|—\[\]]/g, ""));
                logger.error("输入格式不正确!");
            } else {
                if (that.value.replace(/[^\x00-\xff]/g, "aa").length > 40) {
                    $(that).val(that.value.substring(0, 40));
                    logger.error("长度超过限制!");
                }
            }
        }
        if (type == 'englishNumber') {
            if (/[^\a-\z\A-\Z0-9]/g.test(that.value)) {
                $(that).val(that.value.replace(/[^\a-\z\A-\Z0-9]/g, ""));
                logger.error("输入格式不正确!");
            } else {
                if (that.value.replace(/[^\x00-\xff]/g, "aa").length > 20) {
                    $(that).val(that.value.substring(0, 20));
                    logger.error("长度超过限制!");
                }
            }
        }
        if (type == 'telePhone') {
            if (/[^0-9]/g.test(that.value)) {
                $(that).val(that.value.replace(/[^0-9]/g, ""));
                logger.error("输入格式不正确!");
            } else {
                if (that.value.replace(/[^\x00-\xff]/g, "aa").length > 12) {
                    $(that).val(that.value.substring(0, 12));
                    logger.error("长度超过限制!");
                }
            }
        }
        if (type == 'QQ') {
            if (/[^1-9][0-9]/g.test(that.value)) {
                $(that).val(that.value.replace(/[^1-9][0-9]/g, ""));
                logger.error("输入格式不正确!");
            } else {
                if (that.value.replace(/[^\x00-\xff]/g, "aa").length > 10) {
                    $(that).val(that.value.substring(0, 10));
                    logger.error("长度超过限制!");
                }
            }
        }
        if (type == 'WeChat') {
            if (/[^\a-\z\A-\Z0-9_]/g.test(that.value)) {
                $(that).val(that.value.replace(/[^\a-\z\A-\Z0-9_]/g, ""));
                logger.error("输入格式不正确!");
            } else {
                if (that.value.replace(/[^\x00-\xff]/g, "aa").length > 20) {
                    $(that).val(that.value.substring(0, 20));
                    logger.error("长度超过限制!");
                }
            }
        }
        if (type == 'account') {
            if (/[^\a-\z\A-\Z0-9_]/g.test(that.value)) {
                $(that).val(that.value.replace(/[^\a-\z\A-\Z0-9_]/g, ""));
                logger.error("输入格式不正确!");
            } else {
                if (that.value.replace(/[^\x00-\xff]/g, "aa").length > 20) {
                    $(that).val(that.value.substring(0, 20));
                    logger.error("长度超过限制!");
                }
            }
        }
        if (type == 'phone') {
            if (/[^0-9]/g.test(that.value)) {
                $(that).val(that.value.replace(/[^0-9]/g, ""));
                logger.error("输入格式不正确!");
            } else {
                if (that.value.replace(/[^\x00-\xff]/g, "aa").length > 11) {
                    $(that).val(that.value.substring(0, 11));
                    logger.error("长度超过限制!");
                }
            }
        }
        if (type == 'password') {
            if (/[^\a-\z\A-\Z0-9]/g.test(that.value)) {
                $(that).val(that.value.replace(/[^\a-\z\A-\Z0-9]/g, ""));
                logger.error("输入格式不正确!");
            } else {
                if (that.value.replace(/[^\x00-\xff]/g, "aa").length > 16) {
                    $(that).val(that.value.substring(0, 16));
                    logger.error("长度超过限制!");
                }
            }
        }
        if (type == 'IDnumber') {
            if (/[^0-9Xx]/g.test(that.value)) {
                $(that).val(that.value.replace(/[^0-9Xx]/g, ""));
                logger.error("输入格式不正确!");
            } else {
                if (that.value.replace(/[^\x00-\xff]/g, "aa").length > 18) {
                    $(that).val(that.value.substring(0, 18));
                    logger.error("长度超过限制!");
                }
            }
        }
    }

    $("#editForm_${serializeNum}").bind("ajaxSubmitCallback", function (event, result) {
        if (result.resCode == 200) {
            bootbox.hideAll();
            logger.info(result.resMsg, true);
            toView('sysAdminUserController/sysAdminUserList.do', true, 'POST', {pageSize: 10})
        } else {
            logger.error(result.resMsg);
        }
    });
</script>